/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Services;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author akay
 */
public class DBYemekSil {
    
    private DBcon dbcon;
    private static String sorgu = "delete from yemeklistesi where yid=?";
    private int yid;
    

    public DBYemekSil(int yid) {
        this.yid=yid;
        sil();
    }
    
    public boolean sil() {
        dbcon = new DBcon();
        Connection c = dbcon.getconnect();
        PreparedStatement ps;
        try {
            ps = c.prepareStatement(sorgu);
            ps.setInt(1, yid);
            ps.executeUpdate();
            dbcon.closeConnect(c);
            return true;
        } catch (SQLException ex) {
            Logger.getLogger(DBYemekEkle.class.getName()).log(Level.SEVERE, null, ex);
        }   


        return false;


    }
}
